<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { object as zobject, string as zstring } from 'zod'

onLoad(async (query) => {
  const zparse = zobject({
    path: zstring().regex(/^.+$/).transform(decodeURIComponent),
  }).safeParse(query)
  if (!zparse.success) {
    return
  }

  uni.reLaunch({
    url: `/pages/${zparse.data.path}`,
  })
})
</script>

<template>
  <div></div>
</template>

<style lang="less" scoped></style>
